package com.phantasy.scene.sceneData
{
	public class BinaryMath
	{
		private static var exist:int = 1;
		private static var alpha:int = 2;
		private static var run:int = 4;
		private static var safe:int = 25;
		private static var allSafe:int = 16;
		private static var sell:int = 32;
		private static var arena:int = 1;
		private static var yuliu:int = 128;
		private static var unExist:int = 254;
		private static var unAlpha:int = 253;
		private static var unRun:int = 251;
		private static var unSafe:int = 247;
		private static var unAllSafe:int = 239;
		private static var unSell:int = 223;
		private static var unArena:int = 191;
		private static var unYuliu:int = 127;
		
		
		public static function setCell(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean, _arg7:Boolean, _arg8:Boolean):int
		{
			_arg1 = setExist(_arg1, _arg2);
			_arg1 = setAlpha(_arg1, _arg3);
			_arg1 = setRun(_arg1, _arg4);
			_arg1 = setSafe(_arg1, _arg5);
			_arg1 = setAllSafe(_arg1, _arg6);
			_arg1 = setSell(_arg1, _arg7);
			_arg1 = setArena(_arg1, _arg8);
			return (_arg1);
		}
		
		public static function setExist(_arg1:int, _arg2:Boolean):int
		{
			if (_arg2)
			{
				return ((_arg1 | exist));
			};
			return ((_arg1 & unExist));
		}
		
		public static function setAlpha(_arg1:int, _arg2:Boolean):int
		{
			if (_arg2)
			{
				return ((_arg1 | alpha));
			};
			return ((_arg1 & unAlpha));
		}
		
		public static function setRun(_arg1:int, _arg2:Boolean):int
		{
			if (_arg2)
			{
				return ((_arg1 | run));
			};
			return ((_arg1 & unRun));
		}
		
		public static function setSafe(_arg1:int, _arg2:Boolean):int
		{
			if (_arg2)
			{
				return ((_arg1 | safe));
			};
			return ((_arg1 & unSafe));
		}
		
		public static function setAllSafe(_arg1:int, _arg2:Boolean):int
		{
			if (_arg2)
			{
				return ((_arg1 | allSafe));
			};
			return ((_arg1 & unAllSafe));
		}
		
		public static function setSell(_arg1:int, _arg2:Boolean):int
		{
			if (_arg2)
			{
				return ((_arg1 | sell));
			};
			return ((_arg1 & unSell));
		}
		
		public static function setArena(_arg1:int, _arg2:Boolean):int
		{
			if (_arg2)
			{
				return ((_arg1 | arena));
			};
			return ((_arg1 & unArena));
		}
		
		public static function isExist(_arg1:int):Boolean
		{
			return (((_arg1 & exist) == exist));
		}
		
		public static function isAlpha(_arg1:int):Boolean
		{
			return (((_arg1 & alpha) == alpha));
		}
		
		public static function isRun(_arg1:int):Boolean
		{
			return (((_arg1 & run) == run));
		}
		
		public static function isSafe(_arg1:int):Boolean
		{
			return (((_arg1 & safe) == safe));
		}
		
		public static function isAllSafe(_arg1:int):Boolean
		{
			return (((_arg1 & allSafe) == allSafe));
		}
		
		public static function isSell(_arg1:int):Boolean
		{
			return (((_arg1 & sell) == sell));
		}
		
		public static function isArena(_arg1:int):Boolean
		{
			return (((_arg1 & arena) == arena));
		}
	}
}